package com.example.administrator.uis.view

import android.content.Context
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.Paint
import android.util.AttributeSet
import android.view.View

/**
 * Created by Administrator on 2017/11/10 0010.
 */
class PracticeDrawLineView : View {
    constructor(context: Context?):super(context) {
    }
    constructor(context: Context?, attrs: AttributeSet?):super(context,attrs){
    }
    constructor(context: Context?, attrs: AttributeSet?, defStyle:Int):super(context, attrs,defStyle){

    }

    override fun onDraw(canvas: Canvas?) {
        super.onDraw(canvas)
        var paint= Paint(Paint.ANTI_ALIAS_FLAG)
        paint.strokeWidth=10f
        val points= floatArrayOf(20f, 20f, 120f, 20f, 70f, 20f, 70f, 120f, 20f, 120f, 120f, 120f, 150f, 20f, 250f, 20f, 150f, 20f, 150f, 120f, 250f, 20f, 250f, 120f, 150f, 120f, 250f, 120f)
        canvas?.drawLines(points,paint)

    }

}